package a.e.a;

import java.io.IOException;
import java.io.Writer;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

public class h
  extends g
{
  private int c = 0;
  private Writer g;
  private String h;
  private List i = new ArrayList(20);
  public static boolean j;
  
  public h(Writer paramWriter)
  {
    super(paramWriter);
    this.g = paramWriter;
    this.h = System.getProperty("line.separator");
  }
  
  public void a(String paramString)
    throws IOException
  {
    if (!r.f)
    {
      if (this.c == 0) {
        d();
      }
      a();
      this.g.write("<section name=\"");
      this.g.write(paramString);
    }
    this.i.add(paramString);
    this.g.write("\">");
    this.g.write(this.h);
    this.c += 1;
  }
  
  private void d()
    throws IOException
  {
    try
    {
      this.g.write("<?xml version=\"1.0\" encoding=\"" + System.getProperty("file.encoding") + "\"?>");
      this.g.write(this.h);
    }
    catch (SecurityException localSecurityException) {}
  }
  
  protected void a(String paramString1, String paramString2)
    throws IOException
  {
    a();
    this.g.write("<attribute key=\"" + paramString1 + "\" type=\"String\">");
    this.g.write(paramString2);
    this.g.write("</attribute>");
    this.g.write(this.h);
  }
  
  public void a(String paramString, double paramDouble)
    throws IOException
  {
    a();
    this.g.write("<attribute key=\"" + paramString + "\" type=\"double\">");
    this.g.write(Double.toString(paramDouble));
    this.g.write("</attribute>");
    this.g.write(this.h);
  }
  
  public void a(String paramString, int paramInt)
    throws IOException
  {
    a();
    this.g.write("<attribute key=\"" + paramString + "\" type=\"int\">");
    this.g.write(Integer.toString(paramInt));
    this.g.write("</attribute>");
    this.g.write(this.h);
  }
  
  public void a(String paramString, Number paramNumber)
    throws IOException
  {
    boolean bool = r.f;
    if (!bool) {
      if (!(paramNumber instanceof Integer))
      {
        if (!bool) {
          if (!(paramNumber instanceof Long)) {
            break label45;
          }
        }
      }
      else
      {
        if (bool) {
          break label48;
        }
        a(paramString, paramNumber.intValue());
      }
    }
    if (r.e != 0) {
      label45:
      label48:
      a(paramString, paramNumber.doubleValue());
    }
  }
  
  public void a(String paramString, boolean paramBoolean)
    throws IOException
  {
    a();
    this.g.write("<attribute key=\"" + paramString + "\" type=\"boolean\">");
    this.g.write(Boolean.toString(paramBoolean));
    this.g.write("</attribute>");
    this.g.write(this.h);
  }
  
  public void b(String paramString1, String paramString2)
    throws IOException
  {
    a(paramString1, b(paramString2));
  }
  
  public void a(String paramString, Object paramObject)
    throws IOException
  {
    boolean bool = r.f;
    int k = r.e;
    if (!bool) {
      if (paramObject != null)
      {
        if (!bool) {
          if ((paramObject instanceof Double))
          {
            a(paramString, ((Double)paramObject).doubleValue());
            if ((!bool) && (k == 0)) {
              return;
            }
          }
        }
        if (!bool) {
          if ((paramObject instanceof Integer))
          {
            a(paramString, ((Integer)paramObject).intValue());
            if ((!bool) && (k == 0)) {
              return;
            }
          }
        }
        if (!bool) {
          if ((paramObject instanceof Number))
          {
            a(paramString, ((Number)paramObject).doubleValue());
            if ((!bool) && (k == 0)) {
              return;
            }
          }
        }
        if (!bool) {
          if ((paramObject instanceof Collection))
          {
            a(paramString, "item", (Collection)paramObject);
            if (!bool) {
              if (k == 0) {
                return;
              }
            }
          }
          else
          {
            b(paramString, paramObject.toString());
            if (bool) {
              break label202;
            }
          }
        }
        if (k == 0) {
          return;
        }
      }
      else
      {
        a();
        this.g.write("<attribute key=\"" + paramString + "\"/>");
      }
    }
    label202:
    this.g.write(this.h);
  }
  
  protected String b(String paramString)
  {
    boolean bool = r.f;
    int i1 = r.e;
    int k = 0;
    int m = 0;
    label91:
    label99:
    do
    {
      if (m >= paramString.length()) {
        break;
      }
      n = paramString.charAt(m);
      if ((!bool) && (i1 != 0)) {
        break label113;
      }
      if (!bool)
      {
        if (n <= 127) {
          if (bool) {
            break label91;
          }
        }
      }
      else if (n != 10)
      {
        if (bool) {
          break label91;
        }
        if (n != 38)
        {
          if (bool) {
            continue;
          }
          if (n != 60) {
            break label99;
          }
        }
      }
      k = 1;
      if (!bool)
      {
        if (i1 == 0) {
          break;
        }
        m++;
      }
    } while (i1 == 0);
    if ((!bool) && (k == 0)) {
      label113:
      return paramString;
    }
    StringBuffer localStringBuffer = new StringBuffer(paramString.length() + 5);
    int n = 0;
    label281:
    do
    {
      if (n >= paramString.length()) {
        break;
      }
      if ((!bool) && (i1 != 0)) {
        break label293;
      }
      char c1 = paramString.charAt(n);
      if (!bool) {
        if (c1 > '')
        {
          localStringBuffer.append("&#x");
          localStringBuffer.append(Integer.toHexString(c1));
          localStringBuffer.append(';');
          if (bool) {
            continue;
          }
          if (i1 == 0) {
            break label281;
          }
        }
      }
      if (!bool) {}
      switch (c1)
      {
      case '&': 
        localStringBuffer.append("&amp;");
        if (bool) {
          continue;
        }
        if (i1 == 0) {
          break;
        }
      case '<': 
        localStringBuffer.append("&lt;");
        if (bool) {
          continue;
        }
        if (i1 == 0) {
          break;
        }
      default: 
        localStringBuffer.append(c1);
      }
      n++;
    } while (i1 == 0);
    label293:
    return localStringBuffer.toString();
  }
  
  public void b()
    throws IOException
  {
    this.c -= 1;
    a();
    this.g.write("</section>");
    this.i.remove(this.i.size() - 1);
    this.g.write(this.h);
  }
  
  public int c()
  {
    return this.c;
  }
}


/* Location:           E:\idea\
 * Qualified Name:     a.e.a.h
 * JD-Core Version:    0.7.0.1
 */